<template>
  <div>
    <p>{{word}}</p>
    <button @click="btnFn">点击说笑话</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      word:'',
      jokeArr: ['最近感觉记忆力下降得厉害', 
      '于是就找了一个记事本',
      '把每天重要的事情都记下来' ,
       '可是今天早上起来, 差不多把床都拆了',
       '愣是没找到记事本.....']
    };
  },

  methods: {
     btnFn() {
       
      let num=  Math.floor(Math.random() * this.jokeArr.length)
      this.word = this.jokeArr[num]
    }
  },
};
</script>

<style lang="scss" scoped>

</style>